home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / shells / sh03src.zoo / sh-pl03 / sh / token.def < prev    next >
Encoding:
Text File  |  1993-03-22  |  1.1 KB  |  109 lines

  1. #define TEOF 0
  2. #define TNL 1
  3. #define TSEMI 2
  4. #define TBACKGND 3
  5. #define TAND 4
  6. #define TOR 5
  7. #define TPIPE 6
  8. #define TLP 7
  9. #define TRP 8
  10. #define TENDCASE 9
  11. #define TENDBQUOTE 10
  12. #define TREDIR 11
  13. #define TWORD 12
  14. #define TIF 13
  15. #define TTHEN 14
  16. #define TELSE 15
  17. #define TELIF 16
  18. #define TFI 17
  19. #define TWHILE 18
  20. #define TUNTIL 19
  21. #define TFOR 20
  22. #define TDO 21
  23. #define TDONE 22
  24. #define TBEGIN 23
  25. #define TEND 24
  26. #define TCASE 25
  27. #define TESAC 26
  28.  
  29. /* Array indicating which tokens mark the end of a list */
  30. const char tokendlist[] = {
  31.     1,
  32.     0,
  33.     0,
  34.     0,
  35.     0,
  36.     0,
  37.     0,
  38.     0,
  39.     1,
  40.     1,
  41.     1,
  42.     0,
  43.     0,
  44.     0,
  45.     1,
  46.     1,
  47.     1,
  48.     1,
  49.     0,
  50.     0,
  51.     0,
  52.     1,
  53.     1,
  54.     0,
  55.     1,
  56.     0,
  57.     1,
  58. };
  59.  
  60. char *const tokname[] = {
  61.     "end of file",
  62.     "newline",
  63.     "\";\"",
  64.     "\"&\"",
  65.     "\"&&\"",
  66.     "\"||\"",
  67.     "\"|\"",
  68.     "\"(\"",
  69.     "\")\"",
  70.     "\";;\"",
  71.     "\"`\"",
  72.     "redirection",
  73.     "word",
  74.     "\"if\"",
  75.     "\"then\"",
  76.     "\"else\"",
  77.     "\"elif\"",
  78.     "\"fi\"",
  79.     "\"while\"",
  80.     "\"until\"",
  81.     "\"for\"",
  82.     "\"do\"",
  83.     "\"done\"",
  84.     "\"{\"",
  85.     "\"}\"",
  86.     "\"case\"",
  87.     "\"esac\"",
  88. };
  89.  
  90. #define KWDOFFSET 13
  91.  
  92. char *const parsekwd[] = {
  93.     "if",
  94.     "then",
  95.     "else",
  96.     "elif",
  97.     "fi",
  98.     "while",
  99.     "until",
  100.     "for",
  101.     "do",
  102.     "done",
  103.     "{",
  104.     "}",
  105.     "case",
  106.     "esac",
  107.     0
  108. };
  109.